package osami.communication.translate;

public abstract class Translator
{
	protected String iName = null;
	
	/**
	 * General constructor of the translator class.
	 * 
	 * @param aName
	 */
	public Translator( String aName )
	{
		iName = aName;
	}
	
	/**
	 * Return the name of the translator.
	 * 
	 * @return The name of the translator.
	 */
	public String getName()
	{
		return iName;
	}
	
	/**
	 * Translates a String message into an OSAMI message.
	 * 
	 * @param aMsg
	 * @return Translated OSAMI Message.
	 * @throws TranslationException
	 */
	public abstract Message translate( String aMsg ) throws TranslationException;

	/**
	 * Translates an OSAMI Message into a String message.
	 * 
	 * @param aMsg
	 * @return Translated String message.
	 * @throws TranslationException
	 */
	public abstract String translate( Message aMsg ) throws TranslationException;
}
